package homework1;

import java.util.Objects;

public class Student {
	private String stuno;
	private int age;
	private String name;
	private String idcard;

	public Student() {
	}

	public Student(String stuno, int age, String name, String idcard) {
		this.stuno = stuno;
		this.age = age;
		this.name = name;
		this.idcard = idcard;
	}

	public String getStuno() {
		return stuno;
	}

	public void setStuno(String stuno) {
		this.stuno = stuno;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getIdcard() {
		return idcard;
	}

	public void setIdcard(String idcard) {
		this.idcard = idcard;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (!(o instanceof Student))
			return false;
		Student student = (Student) o;
		return Objects.equals(getStuno(), student.getStuno());
	}

	@Override
	public int hashCode() {
		return Objects.hash(getStuno());
	}

	@Override
	public String toString() {
		final StringBuilder sb = new StringBuilder("Student").append('[').append("stuno=").append(stuno).append("age=")
				.append(age).append(",name=").append(name).append(",idcard=").append(idcard).append(']');
		return sb.toString();
	}
}
